package com.atguigu.gulimall.ware.service;

import com.atguigu.common.to.HasStockVo;
import com.atguigu.common.to.mq.OrderTo;
import com.atguigu.common.to.mq.StockLockTo;
import com.atguigu.gulimall.ware.vo.FareVo;
import com.atguigu.gulimall.ware.vo.WareSkuLockVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.ware.entity.WareSkuEntity;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.transaction.annotation.Transactional;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author shujun
 * @email 961624576@qq.com
 * @date 2024-01-14 18:19:44
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    void unlockStock(StockLockTo stockLockTo) throws IOException;

    PageUtils queryPage(Map<String, Object> params);

    void addStock(Long skuId, Long wareId, Integer skuNum);

    List<HasStockVo> hasStock(List<Long> skuIds);

    FareVo fare(Long addrId);

    boolean lockStock(WareSkuLockVo lockVo);

    void unlockStock(OrderTo order);
}

